package com.heze.xunhuan.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.heze.xunhuan.entity.Message;
import com.heze.xunhuan.vo.PageVO;

import java.util.List;
import java.util.Map;

/**
 * 消息服务接口
 *
 * @author heze-xunhuan
 */
public interface MessageService extends IService<Message> {

    /**
     * 创建会话
     */
    Long createConversation(Long fromUserId, Long toUserId, Long postId, String firstMessage);

    /**
     * 获取会话列表
     */
    PageVO<Map<String, Object>> getConversations(Long userId, Integer page, Integer size);

    /**
     * 发送消息
     */
    Long sendMessage(Long fromUserId, Long toUserId, String messageType, String content,
                     String mediaUrl, Map<String, Object> locationInfo);

    /**
     * 获取聊天记录
     */
    PageVO<Message> getMessages(Long conversationId, Long userId, Integer page, Integer size);

    /**
     * 标记消息已读
     */
    void markAsRead(Long conversationId, Long userId);
}

